﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PhotoList.Dal;

namespace PhotoList.Web.Common
{
    public partial class ucHeader : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadUser();
            }
        }

        private void LoadUser()
        {
            PhotoList.Dal.User uUser = new PhotoList.Dal.User(Page.Session["QT_UID"].ToString());
            if (uUser.IsRoot())
            {
                this.userManage.Visible = true;
                this.createThumbnail.Visible = true;
            }
            else
            {
                this.userManage.Visible = false;
                this.createThumbnail.Visible = false;
            }
        }

        protected void lbExit_Click(object sender, EventArgs e)
        {
            Page.Session.Clear();
        }
    }
}